package com.cysion.study.ui.login

import android.view.View
import com.cysion.other.color
import com.cysion.study.MainActivity
import com.cysion.study.R
import com.cysion.study.ktbox.Box
import com.cysion.study.ktbox.base.BaseActivity
import com.cysion.study.ktbox.utils.ACache
import com.cysion.study.uibox.bar.TopBar
import com.cysion.study.widget.UIHelper
import kotlinx.android.synthetic.main.activity_user_switch.*

class UserSwitchActivity :BaseActivity(), View.OnClickListener {
    override fun getLayoutId(): Int {
        return R.layout.activity_user_switch
    }

    override fun initView() {
        topbar.apply {
            setTitleBackColor(color(R.color.white))
            initElements(TopBar.ELEMENT.HIDE, TopBar.ELEMENT.TEXT, TopBar.ELEMENT.HIDE)
            setTitle("牛课工场身份选择")
            setTitleColor(color(R.color.black))
           /* setOnTopBarClickListener { obj, pos ->
               if (pos == TopBar.Pos.LEFT) {
                    finish()
                }
            }*/
        }

        ll_pteacher.setOnClickListener(this)
        ll_teacher.setOnClickListener(this)
    }

    override fun closeMvp() {
    }

    override fun onClick(v: View?) {
        var type = ""//登录类型 1普通老师 2.家教
        when (v?.id) {
            R.id.ll_teacher->{//普通老师
                type = "1"
            }
            R.id.ll_pteacher->{//家教
                type = "2"

            }
        }
        ACache.get(Box.context).put("teacherType", type)
        UIHelper.jump(this,MainActivity::class.java)
    }

}
